
const totalCount = 1000000
export function request({ page: pageNo, pageSize }) {
  return new Promise((resolve) => {
    setTimeout(() => {
      const response = {
        data: {
          record: [...Array(pageSize)].map((_, index) => {
            return [...Array(pageSize)].reduce((res, a, fieldIndex) => {
              let v = `column-${fieldIndex}`
              res[v] = `${v}--row-${index}--page-${pageNo}`
              return res
            }, {})
          }),
          page: pageNo,
          totalCount,
          totalPages: Math.floor(totalCount / pageSize),
          pageSize
        }
      }
      resolve(response)
    }, 1000)
  })
}